<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.wing.sys.domain.User" %>
<%@ include file="/pub/includ.jsp"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
	User user = (User)request.getAttribute("data");
%>
<html>
	<head></head>
	<script type="text/javascript">
		$(document).ready(function(){
			//$.formValidator.initConfig({formid:"userform"});
			$.formValidator.initConfig({formid:"userform",alertmessage:false,onerror:function(msg){alert(msg)}});
			$("#login_code").formValidator().inputValidator({min:4,max:10,onerror:"你输入的登陆账号非法,请确认"})
			    .ajaxValidator({
			    type : "get",
			    async: false,
				url : "<%=path%>/sys/user/vlgcode?userId="+document.getElementById("id").value,
				datatype : "html",
				success : function(data){
		            if( data == "success" )
					{
		                return true;
					}
		            else
					{
		                return false;
					}
				},
				onerror : "该用户名已注册不可用，请更换用户名",
				onwait : "正在对用户名进行合法性校验，请稍候..."
			}).defaultPassed();
			$("#password").formValidator().inputValidator({min:1,max:9,onerror:"密码输入错误，请确认"});
			$("#name").formValidator({empty:"true"}).inputValidator({min:1,max:6,onerror:"姓名错误，请确认"});
            $("#email").formValidator({empty:"true",defaultvalue:"@126.com"}).inputValidator({min:6,max:100,onerror:"你输入的邮箱长度非法,请确认"}).regexValidator({regexp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onerror:"你输入的邮箱格式不正确"});
            $("#bank_account").formValidator({empty:"true"}).inputValidator({min:1,max:20,onerrormax:"银行账号过长",onerror:"银行账号错误，请确认"});
			$("#education").formValidator({empty:"true"}).inputValidator({min:1,max:8,onerror:"学历错误，请确认"});
			$("#mobile").formValidator({empty:true}).inputValidator({min:11,max:11,onerror:"手机号码必须是11位的,请确认"}).regexValidator({regexp:"mobile",datatype:"enum",onerror:"您输入的手机号码格式不正确"});
            $("#office_phone").formValidator({empty:"true"}).inputValidator({min:1,max:15,onerror:"办公室电话错误，请确认"}).regexValidator({regexp:"[0-9]{0,9}",onerror:"您输入的办公室电话号码格式不正确"});
			$("#remarks").formValidator({empty:"true"}).inputValidator({min:1,max:11,onerror:"备注错误，请确认"});
			$("#order_num").formValidator({empty:"true"}).inputValidator({min:1,max:11,onerror:"排序号错误，请确认"});
			
		});	
		var save = function(){
			var flag = "failure";
			if($.formValidator.pageIsValid()){
				var options = {
					type: 'POST',
					async: false,
					dataType: 'content-type',
					success: function(msg) {
						flag = msg;
					}
				}
				$('#userform').ajaxSubmit(options);
			}
			return flag;
		}
	</script>
	<body>
<form action="<%=path %>/sys/user/save" method="post" name="userform" id="userform">
<input type="hidden" name="site_id" value="yblsite001"/>
<table><tr><td height="2px"></td></tr></table>
<table align="center" width="70%" border="0" cellpadding="5" cellspacing="1" class="table_nbw">
	<tr>
		<td align="right" width="40%" style="background-color:fff;height:25px;">登陆账号：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="login_code" name="login_code" value="${data.login_code}"><span style="color:red;font-weight:bold">*</span></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">登陆密码：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="password" id="password" name="password" value="${data.password}"><span style="color:red;font-weight:bold">*</span></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">姓名：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="name" name="name" value="${data.name}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">Email：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="email" name="email" value="${data.email}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">银行账号：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="bank_account" name="bank_account" value="${data.bank_account}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">性别：</td>
		<td align="left" style="background-color:fff">&nbsp;
			<input type="radio" value="男" checked="checked" name="sex" />男&nbsp;&nbsp;
			<input type="radio" value="女" <%if("女".equals(user.getSex())){ %>checked="checked" <%} %>name="sex" />女
			
			
		</td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">学历：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="education" name="education" value="${data.education}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">手机：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="mobile" name="mobile" value="${data.mobile}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">办公室电话：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="office_phone" name="office_phone" value="${data.office_phone}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">备注：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="remarks" name="remarks" value="${data.remarks}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
	<tr>
		<td align="right" style="background-color:fff;height:25px;">排序号：</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="order_num" name="order_num" value="${data.order_num}"></td>
		<td align="left" style="background-color:fff"></td>
	</tr>
</table>	
		<input type="hidden" name="id" value="${data.id}" />
		<input type="hidden" name=orgIds value="${orgIds}" />
		<input type="hidden" name="createtimeView" value="${data.createtimeView}" />
		<input type="hidden" name="payment_unit" value="${data.payment_unit}" />
</form>
	</body>
</html>